import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooCmsCategoryController } from '../../../controllers';
const uctoocmsCategoryRouter = new Router();
const cmsCategoryController = new uctooCmsCategoryController();

uctoocmsCategoryRouter.post('/add', requireUser, cmsCategoryController.add);
uctoocmsCategoryRouter.post('/edit', requireUser, rowLevelPermission('uctoo/cms_category'), cmsCategoryController.edit);
uctoocmsCategoryRouter.post('/del', requireUser, rowLevelPermission('uctoo/cms_category'), cmsCategoryController.delete);

//For getting cmsCategory with permission control
uctoocmsCategoryRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/cms_category'), cmsCategoryController.getSingle);
uctoocmsCategoryRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/cms_category'), cmsCategoryController.getMany);
uctoocmsCategoryRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/cms_category'), cmsCategoryController.getMany);

//#endregion AutoCreateCode
export default uctoocmsCategoryRouter;
